package com.wq.wrongquestion.serviceimpl.pol;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.pol.PoliticsEntity;
import com.wq.wrongquestion.mapper.pol.PoliticsMapper;
import com.wq.wrongquestion.service.pol.PoliticsService;

@Component
public class PoliticsServiceimpl implements PoliticsService {
    
    @Autowired
    public PoliticsMapper PoliticsMapper;
    @Override
    @Transactional
    public String getPoliticsZjnm(String zjID) {
        String zjNm=PoliticsMapper.getPoliticsZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getPoliticsZjID() {
       List<String> allZjID=PoliticsMapper.getPoliticsZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getPoliticsZj() {
        List<String> zjInfo=PoliticsMapper.getPoliticsZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insPolitics(PoliticsEntity PoliticsEntity) {
        PoliticsMapper.insPolitics(PoliticsEntity);
    }
    @Override
    @Transactional
    public PageInfo<PoliticsEntity> getPolitics(Integer pageNumer,Integer pageSize,PoliticsEntity PoliticsEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<PoliticsEntity> Politics=PoliticsMapper.getPolitics(PoliticsEntity);
        PageInfo<PoliticsEntity> pagePolitics=new PageInfo<>(Politics);
        return pagePolitics;
    }

    @Override
    @Transactional
    public List<PoliticsEntity> getPoliticsByID(Integer id) {
        List<PoliticsEntity> Politics=PoliticsMapper.getPoliticsByID(id);
        return Politics;
    }
    @Override
    @Transactional
    public Integer updPolitics(PoliticsEntity PoliticsEntity) {
        return PoliticsMapper.updPolitics(PoliticsEntity);
    }
    @Override
    @Transactional
    public Integer delPolitics(Integer id) {
        return PoliticsMapper.delPolitics(id);
    }
    
}
